﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace GeneticAlgorithm
{
	class Evaluate
	{
		// 선택된 부모해 평가
		// AL  : Population Index
		// <Result>: Define.TTWG의 값 만족 평가
		public static bool EvaluateFitness( Hashtable AL )
		{
			IDictionaryEnumerator EM = AL.GetEnumerator();
			int summ = 0;
			int numb = 0;

			ICollection WG = AL.Values;
			foreach ( object objc in WG )
			{
				numb = int.Parse( string.Format( "{0}", objc ) );
				summ += numb;
			}

			if ( summ < Define.TTWG)
				return true;
			else
				return false;
		}
	}
}
